//
//  ACPClassDescModel.m
//  AutoCreatePropertyDemo
//
//  Created by anmin on 2017/11/29.
//  Copyright © 2017年 puhui. All rights reserved.
//

#import "ACPClassDescModel.h"

@implementation ACPClassDescModel

- (id)initWithDictionary:(NSDictionary *)dict {
    self = [super init];
    if (self) {
        if (!dict || [dict isEqual:@{}]) {
            return nil;
        }
        self.superClassName = dict[@"superClassName"];
        self.className = dict[@"className"];
        self.propertyName = dict[@"propertyName"];
        self.subModel = [[ACPClassDescModel alloc] initWithDictionary:dict[@"subModel"]];
    }
    return self;
}

- (NSDictionary *)info {
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    dict[@"className"] = self.className;
    dict[@"propertyName"] = self.propertyName;
    dict[@"subModel"] = [self.subModel info];
    dict[@"superClassName"] = self.superClassName;
    return dict;
}

@end
